package com.ddm.entity.webEntity;


import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * <p>
 * 新闻信息
 * </p>
 *
 * @author hpq
 * @since 2025/05/08
 */
@Data
@ApiModel(value = "New对象", description = "新闻信息实体")
@TableName(value = "new", autoResultMap = true)
public class New {

    @ApiModelProperty(value = "新闻表id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "新闻链接")
    private String url;

    @TableField(typeHandler = FastjsonTypeHandler.class)
    private JSONArray content;

    @ApiModelProperty(value = "新闻图片")
    private String img;

    @ApiModelProperty(value = "发布日期")
    @TableField("public_date")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime publicDate;

    @ApiModelProperty(value = "发布者")
    private String publisher;

    @ApiModelProperty(value = "视频标题")
    private String title;
}
